package com.falcon.domain.req;

import com.falcon.domain.po.MenuComponentPO;
import com.falcon.mvc.domain.AbsPageQuery;
import com.falcon.domain.po.MenuComponentPO.Fields;
import com.swan.mybatis.condition.Condition;
import com.swan.mybatis.condition.OpType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;


/** 菜单组件表
* @author zongf
* @since 2024-03-14
*/
@Data
@Accessors(chain = true)
public class MenuComponentQuery extends AbsPageQuery{

    /** 菜单ID */
    private Long id;

    /** 创建者 */
    private String creator;

    /** 创建时间 */
    private Date createTime;

    /** 更新者 */
    private String updater;

    /** 更新时间 */
    private Date updateTime;

    /** 模块名 */
    private String moduleName;

    /** 组件名称 */
    private String name;

    /**  */
    private String srcPath;

    /** 备注 */
    private String remark;

    /** 状态: 0-不可用 1-可用 */
    private Integer status;

    @Override
    public Condition toCondition() {
        Condition condition = Condition.newInstance();

        condition.and(Fields.name, OpType.like, this.name)
                .and(MenuComponentPO.Fields.moduleName, OpType.like, this.moduleName)
                .and(Fields.status, OpType.equals, this.status);

        return condition;
    }

}

